Skip to content

Add public API for MCP server installation#122

Merged
cevian merged 4 commits intomainfrom
feature/public-mcp-install-api
Dec 5, 2025
Merged

Add public API for MCP server installation#122
cevian merged 4 commits intomainfrom
feature/public-mcp-install-api

Conversation

@cevian
Copy link
Contributor

@cevian cevian commented Dec 4, 2025

Summary

  • Introduces pkg/mcpinstall package that allows external projects to install MCP server configurations for various AI coding assistants
  • Provides InstallForClient() function with configurable ServerName, Command, and Args
  • Exports Client type constants (Cursor, ClaudeCode, VSCode, etc.) for type-safe client selection
  • Refactors internal implementation to separate generic InstallMCPForClient() from Tiger-specific installTigerMCPForClient() wrapper

Example Usage

import "github.com/timescale/tiger-cli/pkg/mcpinstall"

err := mcpinstall.InstallForClient(mcpinstall.Cursor, mcpinstall.Options{
    ServerName:   "my-mcp-server",
    Command:      "/usr/local/bin/my-mcp-server",
    Args:         []string{"serve", "--port", "8080"},
    CreateBackup: true,
})

🤖 Generated with Claude Code

Introduces pkg/mcpinstall package that allows external projects to
install MCP server configurations for various AI coding assistants.

The API provides:
- InstallForClient() function with configurable ServerName, Command, and Args
- Client type constants (Cursor, ClaudeCode, VSCode, etc.)
- Options struct for installation configuration

Refactors internal implementation to separate generic InstallMCPForClient()
from Tiger-specific installTigerMCPForClient() wrapper.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cevian cevian requested a review from nathanjcochran December 4, 2025 16:31
Copy link
Member

@nathanjcochran nathanjcochran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a handful of minor comments/questions/suggestions, but overall looks good 👍

// InstallMCPForClient installs an MCP server configuration for the specified client.
// This is a generic, configurable function exported for use by external projects via pkg/mcpinstall.
// Required options: ServerName, Command, Args must all be provided.
func InstallMCPForClient(clientName string, opts InstallOptions) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to include ClientName in the InstallOptions struct, instead of it being a separate parameter? Especially since there are already other required fields in InstallOptions, so callers will have to provide it regardless.

cevian and others added 3 commits December 5, 2025 10:34
- Fix VSCode buildInstallCommand to marshal entire JSON struct including
  name, command, and args (not just args)
- Fix InstallOptions comments to say "(required)" instead of incorrect
  "(default: ...)" mentions
- Simplify tests to pass "tiger" string directly instead of roundabout
  getTigerExecutablePath() calls
- Remove unused Client type and constants from public package since
  InstallForClient takes clientName string, not Client type

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Per PR review feedback, move clientName from a separate function parameter
into the InstallOptions struct. This keeps all configuration in one place.

- Add ClientName field to InstallOptions (required)
- Change InstallMCPForClient signature from (clientName, opts) to just (opts)
- Rename public API function from InstallForClient to Install
- Reorder struct fields to group required fields together

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add ClientInfo struct and SupportedClients() function to expose
available MCP clients. This allows external users to discover valid
values for Options.ClientName.

ClientInfo contains:
- Name: Human-readable display name (e.g., "Claude Code")
- ClientName: Identifier for Options.ClientName (e.g., "claude-code")

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@cevian cevian merged commit 1345519 into main Dec 5, 2025
2 checks passed
@cevian cevian deleted the feature/public-mcp-install-api branch December 5, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants